package com.iplant.basic.service.po.cfg;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;

import java.io.Serializable;


/**
 * 单位转换
 *
 * @author YouWang·Peng
 * 2023-7-18 14:53:50
 */
@DBBasePO(TableName = "cfg_unitconversion", AutoCreateTable = true, CheckName = {"Code", "Name", "OriginalUnitID," +
        "TargetUnitID"}, CodeAuto = true,
        CodePrefix = "UC-", CodeNum = 4)
public class CFGUnitConversion extends BasePO implements Serializable {

    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 原始单位ID
     */
    @DBField
    @DBCondition
    public int OriginalUnitID = 0;
    /**
     * 原始单位编码
     */
    @DBJoin(name = "Code", tableName = "mss_unit", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "OriginalUnitID")
    public String OriginalUnitCode = "";
    /**
     * 原始单位名称
     */
    @DBJoin(name = "Name", tableName = "mss_unit", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "OriginalUnitID")
    public String OriginalUnitName = "";
    /**
     * 目标单位ID
     */
    @DBField
    @DBCondition
    public int TargetUnitID = 0;
    /**
     * 目标单位编码
     */
    @DBJoin(name = "Code", tableName = "mss_unit", tableAsName = "t2", Schemas = DBSchemas.Basic,
            MainTableField = "TargetUnitID")
    public String TargetUnitCode = "";
    /**
     * 目标单位名称
     */
    @DBJoin(name = "Name", tableName = "mss_unit", tableAsName = "t2", Schemas = DBSchemas.Basic,
            MainTableField = "TargetUnitID")
    public String TargetUnitName = "";

    /**
     * 转换比例
     */
    @DBField
    public double ConversionRatio = 0.0;

    public CFGUnitConversion() {
        super();
    }

    @JsonProperty("OriginalUnitID")
    public int getOriginalUnitID() {
        return OriginalUnitID;
    }

    public void setOriginalUnitID(int originalUnitID) {
        OriginalUnitID = originalUnitID;
    }

    @JsonProperty("OriginalUnitCode")
    public String getOriginalUnitCode() {
        return OriginalUnitCode;
    }

    public void setOriginalUnitCode(String originalUnitCode) {
        OriginalUnitCode = originalUnitCode;
    }

    @JsonProperty("OriginalUnitName")
    public String getOriginalUnitName() {
        return OriginalUnitName;
    }

    public void setOriginalUnitName(String originalUnitName) {
        OriginalUnitName = originalUnitName;
    }

    @JsonProperty("UnitID")
    public int getTargetUnitID() {
        return TargetUnitID;
    }

    public void setTargetUnitID(int targetUnitID) {
        TargetUnitID = targetUnitID;
    }

    @JsonProperty("UnitCode")
    public String getTargetUnitCode() {
        return TargetUnitCode;
    }

    public void setTargetUnitCode(String targetUnitCode) {
        TargetUnitCode = targetUnitCode;
    }

    @JsonProperty("UnitName")
    public String getTargetUnitName() {
        return TargetUnitName;
    }

    public void setTargetUnitName(String targetUnitName) {
        TargetUnitName = targetUnitName;
    }

    @JsonProperty("ConversionRatio")
    public double getConversionRatio() {
        return ConversionRatio;
    }

    public void setConversionRatio(double conversionRatio) {
        ConversionRatio = conversionRatio;
    }
}
